package cn.mymall.service.mall.impl;

import cn.mymall.entity.mall.Brand;
import cn.mymall.mapper.BrandMapper;
import cn.mymall.service.impl.BaseServiceImpl;
import cn.mymall.service.mall.IBrandService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrandServiceImpl extends BaseServiceImpl<BrandMapper, Brand> implements IBrandService {

	@Override
	public List<Brand> findByCategoryId(Integer categoryId) {
		return list(new QueryWrapper<Brand>().eq("category_id", categoryId));
	}
	@Override
	public List<Brand> findByCategoryId2(Integer categoryId) {
		return list(new QueryWrapper<Brand>().eq("category_id", categoryId).gt("sort_num", 0).orderByAsc("sort_num"));
	}
}
